﻿namespace Preactor.ObjectModel.BaseTypes.MaterialControl
{
    using System;

    using Preactor.ObjectModel.Attributes;
    using Preactor.ObjectModel.Entities;
    using Preactor.ObjectModel.Interfaces.MaterialControl;

    public class MaterialControlConfiguration : PreactorRecord, IMaterialControlConfiguration
    {
        public MaterialControlConfiguration(PrimaryKey id, PreactorObjectModel preactorObjectModel)
            : base(id, preactorObjectModel)
        {
        }

        [PreactorField("MATERIAL CONTROL CONFIGURATION TABLE", FieldDeclarationType.FieldClassification)]
        public int Number { get { return (int)GetValue("Number"); } set { SetValue("Number", value); } }

        [PreactorField("SELECTED RULE SET", FieldDeclarationType.FieldClassification)]
        public string SelectedPeggingRuleSet { get { return (string)GetValue("SelectedPeggingRuleSet"); } set { SetValue("SelectedPeggingRuleSet", value); } }

        [PreactorField("ALLOW BACKWARD LINKS", FieldDeclarationType.FieldClassification)]
        public bool AllowBackwardLinks { get { return (bool)GetValue("AllowBackwardLinks"); } set { SetValue("AllowBackwardLinks", value); } }

        [PreactorField("FORCE DEFAULT RULE", FieldDeclarationType.FieldClassification)]
        public bool AlwaysUseThisRuleSet { get { return (bool)GetValue("AlwaysUseThisRuleSet"); } set { SetValue("AlwaysUseThisRuleSet", value); } }

    }
}